<%@ page pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String contexts = request.getContextPath();
    pageContext.setAttribute("ctx", contexts);
%>
<html>

<link type="text/css" rel="stylesheet" href="${ctx}/css/login/article/articleCss.css">
<link rel="stylesheet" href="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script type="text/javascript" src="${ctx}/js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="${ctx}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${ctx}/js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="${ctx}/js/login/article/addArticle.js"></script>
<body>
<div id="returnList">
    <div id="div_editArticle">
        <div align="center"><h2>修改文章</h2></div>

        <s:form class="form-horizontal" id="editArticle" action="editArticle" role="form" namespace="/" method="POST"
                enctype="multipart/form-data">
            <div class="form-group" id="div_articleName">
                <label for="title" class="col-sm-2 control-label">标题 :</label>

                <div class="col-sm-10">
                    <input type="text" class="form-control" id="title" name="articleVO.title"
                           placeholder="请编辑你的文章标题..." value="${articleVO.title}">
                </div>

            </div>
            <div class="form-group" id="div_editContent">
                <label for="inputCategoryName" class="col-sm-2 control-label">分类名 :</label>

                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputCategoryName" name="categoryVO.categoryName"
                           placeholder="请设置文章的分类..." value="${categoryVO.categoryName}">
                </div>
            </div>
            <div class="form-group" id="div_editContent">
                <label class="col-sm-2 control-label">标签名 :</label>

                <div class="col-sm-10">
                    <c:forEach items="${articleVO.articleLabelVOs}" var="label">
                    <input type="text" class="form-control labelWidth" name="labelVOs[0].labelName"
                           value="${label.labelVO.labelName}">
                    </c:forEach>

                </div>
            </div>


            <div class="form-group heightForTextArea">
                <label for="title" class="col-sm-2 control-label">正文 :</label>

                <div class="col-sm-10">
                     <textarea id="content" name="articleVO.content" cols="45"
                               rows="10">${articleVO.content}</textarea>
                </div>
            </div>

            <div class="form-group" id="div_submit">
                <div id="message">${message}</div>
                <div class="col-sm-offset-2">
                    <button id="div_submit_val" type="button" class="btn btn-info" onclick="editArticleSubmit()">确定
                    </button>
                    <button type="button" class="btn btn-info"
                            onclick="location.href='${ctx }/pageOfArticleByBlogData.action'">
                        返回文章列表
                    </button>
                </div>
            </div>
        </s:form>
    </div>
</div>
</body>
</html>